/*
 * @(#)Crypt.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

package com.dcivision.workflow.applet;

import java.awt.Color;
import java.awt.datatransfer.StringSelection;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;

import javax.swing.JTree;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

/**
StepInformationWindow.java

@author          Beyond
@company         DCIVision Limited
@creation date   27/08/2004
@version         $Revision: 1.2 $
*/
class DragTrees extends JTree
 implements DragGestureListener, DragSourceListener
{

 public DragTrees()
 {
     DragSource dragSource = DragSource.getDefaultDragSource();
     dragSource.createDefaultDragGestureRecognizer(this, 3, this);
     
 }

 public DragTrees(DefaultMutableTreeNode node)
 {
     super(node);
     this.setBackground(new Color(150,200,250));
     //this.setOpaque(false);
     DragSource dragSource = DragSource.getDefaultDragSource();
     dragSource.createDefaultDragGestureRecognizer(this, 3, this);
     setModel(new DefaultTreeModel(node));
     addTreeExpansionListener(new TreeExpansionListener() {

         public void treeCollapsed(TreeExpansionEvent treeexpansionevent)
         {
         }

         public void treeExpanded(TreeExpansionEvent treeexpansionevent)
         {
         }

     });
 }

 public void dragGestureRecognized(DragGestureEvent e)
 {
     e.startDrag(DragSource.DefaultCopyDrop, new StringSelection("Bad Drop!"), this);
 }

 public void dragDropEnd(DragSourceDropEvent dragsourcedropevent)
 {
 }

 public void dragEnter(DragSourceDragEvent dragsourcedragevent)
 {
 }

 public void dragExit(DragSourceEvent dragsourceevent)
 {
 }

 public void dragOver(DragSourceDragEvent dragsourcedragevent)
 {
 }

 public void dropActionChanged(DragSourceDragEvent dragsourcedragevent)
 {
 }

 public String getFilename()
 {
     
     return null;
 }
}